home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Design
/
WB Collection.iso
/
datatypes
/
debox_dt
/
source
/
check.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-07
|
2KB
|
67 lines
/******************************************************************************
*
* Flowerpower's DeBox Datatype
*
* Written by Christian Buchner and David N. Junod
*
******************************************************************************
* check.c
*
*/
#include <exec/types.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <datatypes/datatypes.h>
#include <graphics/gfx.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/utility_protos.h>
#include <pragmas/exec_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include "classbase.h"
/*****************************************************************************/
#undef SysBase
#define SysBase dthc->dthc_SysBase
#undef DOSBase
#define DOSBase dthc->dthc_DOSBase
#undef UtilityBase
#define UtilityBase dthc->dthc_UtilityBase
/*****************************************************************************/
BOOL __asm DTHook (register __a0 struct DTHookContext * dthc)
{
BOOL retval = FALSE;
struct DeBoxChunk *chunk;
/* Make sure we have a FileInfoBlock */
if (dthc->dthc_FIB)
{
/* Make sure we have a buffer */
if (dthc->dthc_Buffer && dthc->dthc_BufferLength>=sizeof(struct DeBoxChunk))
{
/* The buffer is the DeBoxChunk */
chunk=(struct DeBoxChunk*)dthc->dthc_Buffer;
/* Check file size */
if (dthc->dthc_FIB->fib_Size==sizeof(struct DeBoxChunk)+chunk->chunk_len)
{
/* Check header CRC */
if (DeBoxCRC(chunk))
{
retval=TRUE;
}
}
}
}
return(retval);
}